package com.cloudy.cloudspider.search;

import org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer;

import java.util.Objects;

/**
 * Created by cloudy.xie on 18/1/15.
 */
public class SearcherHelp {

    public static SmartChineseAnalyzer getAnalyzer(){
        return new SmartChineseAnalyzer();
    }

    public static String getIndexDir(){
        return getIndexDir( null);
    }

    public static String getIndexDir(String pre){
        String path ="/Users/vipshop/vip-apps/cloudy/cloudspider/data";
        if(pre == null || Objects.equals(pre.trim(), "")){
            return path;
        }
        return path +"/"+pre;
    }
}
